home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6662 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: southern.co.nz!ccom!dave
  2. Newsgroups: comp.sys.amiga.programmer
  3. From: dave@ccom.co.nz (David Eaves)
  4. Subject: Strange bug in window blocking Request() - comments please
  5. X-NewsReader: Interworks_GRn 3.0 January 12, 1996
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=iso-8859-1
  8. Content-Transfer-Encoding: 8bit
  9. Message-ID: <dave.0bmt@ccom.co.nz>
  10. Date: Mon, 1 Apr 96 12:16:14 +1200
  11. Organization: Community Communications
  12.  
  13. I have recently encountered a bug in a program of mine whose effect only
  14. seems detectable if conditions are "just right".  By a careful process of
  15. elimination I think I have tracked it to the way in which I was using an
  16. invisible requester to block window input.  Here is the original code:
  17.  
  18.     InitRequester(req);
  19.     req->LeftEdge = req->TopEdge = -1;
  20.     req->Width = req->Height = 1;
  21.     req->Flags = SIMPLEREQ | NOREQBACKFILL;
  22.     Request(req, window);
  23.  
  24. I am not sure where I got this piece of code from (I think I copied it
  25. from someone else's source), but after reading up the RKM's and autodocs
  26. it seems more correct to do just:
  27.  
  28.     InitRequester(req);
  29.     Request(req, window);
  30.  
  31. This *seems* to have eliminated the bug, but I cannot be completely sure
  32. yet as this change may have just stopped the bug from showing up in the
  33. way it was.  Note that I have been developing and using the program in
  34. question every day for over a year, and only just discovered the problem
  35. on a different system under very rare circumstances.  It has been run on
  36. the following systems without any ill effects being noticed:
  37.  
  38.   A3000 with AmigaOS 3.1 (my development system, enforcer running)
  39.   A3000 with 2.1
  40.   A4000 with 3.1 (my system at work on which I run the program every day)
  41.   A4000 with 3.0
  42.  
  43. I tried it on a chip only A1200 running 3.0 and set up with MuFS.  If I
  44. started the program immediately after booting, exited, and did an mlist of
  45. a directory the owner names would be slightly garbled (eg root would show
  46. up as rnot).  If I did anything else (such as opening a shell, or running
  47. a debugger) before running my program then I would not notice any ill
  48. effect.
  49.  
  50. Does the original piece of code seem a likely culprit?  Perhaps I just
  51. hadn't noticed the problem before as I'm usually running 3.1 rather than
  52. 3.0?
  53.  
  54. Your comments appreciated,
  55. Dave
  56. -- 
  57. +----------------------------------------------------------------+
  58.  David Eaves, Community Communications, Christchurch, New Zealand
  59.            Phone:  +64-3-3845024,  Fax: +64-3-3841997
  60.            EMail:  dave@ccom.co.nz
  61. +----------------------------------------------------------------+
  62.